Skip to content

List templates and ISOs by domain#11179

Merged
DaanHoogland merged 2 commits intoapache:4.19from
bernardodemarco:list-templates-and-isos-by-domain
Jul 17, 2025
Merged

List templates and ISOs by domain#11179
DaanHoogland merged 2 commits intoapache:4.19from
bernardodemarco:list-templates-and-isos-by-domain

Conversation

@bernardodemarco
Copy link
Member

Description

Currently, it is not possible to list the templates and ISOs of a specific domain. When executing the listTemplates and listIsos APIs only specifying a domainid, all templates/ISOs that the caller has access to are listed; the domainid parameter is completely ignored.

Therefore, this PR proposes to add support for listing templates and ISOs by domain. To achieve that, the listTemplates and listIsos APIs should be called defining the templatefilter and isofilter parameters to either self or selfexecutable. Furthermore, the isrecursive parameter can be used, to list templates and ISOs recursively by domain.


Fixes #10392, #10393

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

image image

How Has This Been Tested?

  • Verified that domain access validation is correctly performed
  • Verified that it is possible to list templates and ISOs by domain when specifying the templatefilter and isofilter parameters to either self or selfexecutable
  • Verified that templates and ISOs are recursively listed when the isrecursive parameter is specified as true

@bernardodemarco
Copy link
Member Author

@DaanHoogland @shwstppr @sureshanaparti targeting this PR to the 4.19 branch because the #10392 milestone is set to 4.19.4

@codecov
Copy link

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 15.18%. Comparing base (7715b3d) to head (1554d1a).
Report is 2 commits behind head on 4.19.

Files with missing lines Patch % Lines
...ain/java/com/cloud/api/query/QueryManagerImpl.java 0.00% 13 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #11179      +/-   ##
============================================
- Coverage     15.18%   15.18%   -0.01%     
  Complexity    11365    11365              
============================================
  Files          5415     5415              
  Lines        475868   475877       +9     
  Branches      58092    58094       +2     
============================================
  Hits          72252    72252              
- Misses       395531   395540       +9     
  Partials       8085     8085              
Flag Coverage Δ
uitests 4.28% <ø> (-0.01%) ⬇️
unittests 15.90% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bernardodemarco
Copy link
Member Author

@blueorangutan package

@bernardodemarco bernardodemarco added this to the 4.19.4 milestone Jul 11, 2025
@blueorangutan
Copy link

@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 14132

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one grumpy old man remark, otherwise lgtm.

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14172

@DaanHoogland
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13776)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 46175 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11179-t13776-kvm-ol8.zip
Smoke tests completed. 133 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@DaanHoogland
Copy link
Contributor

@bernardodemarco I tested this in a lab env but still view the default template and system template when browsing from the (child)domain. Anything I might have missed?

@bernardodemarco
Copy link
Member Author

@bernardodemarco I tested this in a lab env but still view the default template and system template when browsing from the (child)domain. Anything I might have missed?

@DaanHoogland, thanks for testing!

Have you defined the templatefilter and isofilter parameters to be equal to either self or selfexecutable? If so, could you share the API calls that have been performed?

@DaanHoogland
Copy link
Contributor

@bernardodemarco I tested this in a lab env but still view the default template and system template when browsing from the (child)domain. Anything I might have missed?

@DaanHoogland, thanks for testing!

Have you defined the templatefilter and isofilter parameters to be equal to either self or selfexecutable? If so, could you share the API calls that have been performed?

I would expect those to be set by the UI when browsing from the domain page, no?

@bernardodemarco
Copy link
Member Author

bernardodemarco commented Jul 16, 2025

I would expect those to be set by the UI when browsing from the domain page, no?

@DaanHoogland, yes, for sure. I assumed you were performing the API calls directly from CloudMonkey

Can you share the API request the UI is performing (through the browser's inspect tab)?

Also, could you verify the URL the UI is redirecting the calling user to? It should be something like this

image

@DaanHoogland
Copy link
Contributor

I would expect those to be set by the UI when browsing from the domain page, no?

@DaanHoogland, yes, for sure. I assumed you were performing the API calls directly from CloudMonkey

All is good @bernardodemarco , I learned two things:

  • I am working on too much at the same time and tested your functionality in an env without your changes 🤦 .
  • when you select a domain and not an account the ownership defaults back to ROOT and what I suppose would be the caller account.

I am not sure if this second point is worth an issue. In any case we are good to go with this PR.

@DaanHoogland DaanHoogland merged commit bf46458 into apache:4.19 Jul 17, 2025
24 of 25 checks passed
harikrishna-patnala pushed a commit to shapeblue/cloudstack that referenced this pull request Jul 24, 2025
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add View ISO Button to Accounts / Domain Domain - "View Templates" Button Does Not Filter

5 participants